# pickle（泡菜）：Python 对象序列化的第一人
# pickle 模块解决的是永久存储的问题，运行将对象保存为文件的形式

import pickle

x, y, z = 1, 2, 3
s = "FishC"
l = ["小甲鱼", 520, 3.14]
d = {"one": 1, "two": 2}

# wb:二进制
with open("./doc/data.pkl", "wb") as f:
    pickle.dump(x, f)
    pickle.dump(y, f)
    pickle.dump(z, f)
    pickle.dump(s, f)
    pickle.dump(l, f)
    pickle.dump(d, f)

# wb:二进制
with open("./doc/data2.pkl", "wb") as f:
    pickle.dump((x, y, z, s, l, d), f)
